package nio;

import com.test.designPattern.ch23.Strategy;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;

/**
 * @ClassName CopyFileTo
 * @Description TODO
 * @Author 维康
 * @Date 2018/6/15 17:47
 * @Version 1.0
 **/
public class CopyFileTo {


    /**
     * @Description: ${todo}
     * @param ${tags}
     * @return ${return_type}
     * @throws
     * @author Chenwk
     * @date 2018/6/15 17:47
     **/
    public static void main(String[] args) throws IOException {
        String infile = "E:\\es_cq.txt";
        String outfile = "E:\\es_cq_cp.txt";
        FileInputStream fin = new FileInputStream( infile );
        FileOutputStream fout = new FileOutputStream( outfile );
        FileChannel fcin = fin.getChannel();
        FileChannel fcout = fout.getChannel();
        fcin.transferTo(0, fcin.size(), fcout);
    }
}
